from base import Base
from selenium.webdriver.common.by import By
from time import sleep

class SouSuo(Base):
    sousuokaung = (By.XPATH,'//android.widget.LinearLayout[@resource-id="com.kongfz.app:id/ll_search"]')
    shurukuang = (By.XPATH,'//android.widget.EditText[@text="商品名称 作者 出版社 ISBN"]')
    sousuoanniu = 'new UiSelector().resourceId("com.kongfz.app:id/tvSearch")'

    duanyan = 'new UiSelector().resourceId("com.kongfz.app:id/tvHitLeft")'

    def sousuoyewu(self,c):
        #定位搜索框并点击
        self.find_ele(self.sousuokaung).click()
        sleep(2)
        self.find_ele(self.shurukuang).send_keys(c)
        sleep(2)
        self.find_ele(self.sousuoanniu).click()
        sleep(2)
